In [1]:
%pylab inline


Populating the interactive namespace from numpy and matplotlib

In [2]:
agev = np.array([0.075e9, 0.575e9 ,1.5e9, 2.5e9, 4e9,   6e9,   8.5e9])
dagev = np.array([0.075e9, 0.425e9, 0.5e9, 0.5e9, 1e9,   1e9,   1.5e9])

In [3]:
age = (1e10-agev)/1e9
dage = dagev/1e9

In [4]:
time = age

In [5]:
def sfr(time):
    return(np.exp(-0.12*time))

In [6]:
plt.plot(time,sfr(time))


Out[6]:
[<matplotlib.lines.Line2D at 0x7f0cce4aa390>]

In [7]:
sfrv = sfr(time)

In [8]:
sfrv


Out[8]:
array([0.30391719, 0.32271038, 0.36059494, 0.40656966, 0.48675226,
       0.61878339, 0.83527021])

In [9]:
time


Out[9]:
array([9.925, 9.425, 8.5  , 7.5  , 6.   , 4.   , 1.5  ])

In [10]:
dage


Out[10]:
array([0.075, 0.425, 0.5  , 0.5  , 1.   , 1.   , 1.5  ])

In [11]:
sumsfr = dage*sfrv*2
print(sumsfr)


[0.04558758 0.27430383 0.36059494 0.40656966 0.97350451 1.23756678
 2.50581063]

In [12]:
old_sfr = 2.37*10
sum(sumsfr)


Out[12]:
5.803937935843444

In [13]:
old_sfr/(sum(sumsfr))


Out[13]:
4.083434430550273

In [15]:
new_sfr = sumsfr*(old_sfr/sum(sumsfr))

In [16]:
new_sfr


Out[16]:
array([ 0.18615389,  1.12010169,  1.47246579,  1.66020055,  3.97524184,
        5.05352281, 10.23231342])

This vector assumes that weighting with dage is not happening in Galaxia.